package org.br.erp.rfq.po.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * @Description: 采购订单
 * @Author: jeecg-boot
 * @Date:   2023-09-17
 * @Version: V1.0
 */
@ApiModel(value="scmpo对象", description="采购订单")
@Data
@TableName("scmpo")
@Entity
public class Scmpo implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    @Id
    private java.lang.String id;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private java.lang.String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private java.util.Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private java.lang.String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private java.util.Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private java.lang.String sysOrgCode;
	/**单据编号*/
	@Excel(name = "单据编号", width = 15)
    @ApiModelProperty(value = "单据编号")
    private java.lang.String billcode;
	/**单据日期*/
	@Excel(name = "单据日期", width = 15, format = "yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "单据日期")
    private java.util.Date billdate;
	/**地区*/
	@Excel(name = "地区", width = 15)
    @ApiModelProperty(value = "地区")
    private java.lang.String cityid;
	/**地区全名*/
	@Excel(name = "地区全名", width = 15)
    @ApiModelProperty(value = "地区全名")
    private java.lang.String fullcituname;
	/**供应商*/
	@Excel(name = "供应商", width = 15)
    @ApiModelProperty(value = "供应商")
    @Dict(dictTable = "scmpartner",dicCode = "id",dicText = "partnername")
    private java.lang.String vendorid;
	/**备注*/
	@Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private java.lang.String remarks;

    private String xjdbillcode;

    private String plate;

    private String accidentNumber;

    private String dsy;

    private String dsylinktel;

    private String deliveyflag;


    @Excel(name = "附件", width = 15)
    @ApiModelProperty(value = "附件")
    private java.lang.String attachid;

//
//    @Excel(name = "发货图片", width = 15)
//    private transient java.lang.String deliveryimageString;
//
//    private byte[] deliveryimage;
//
//    public byte[] getDeliveryimage(){
//        if(deliveryimageString==null){
//            return null;
//        }
//        try {
//            return deliveryimageString.getBytes("UTF-8");
//        } catch (UnsupportedEncodingException e) {
//            e.printStackTrace();
//        }
//        return null;
//    }

//    public String getDeliveryimageString(){
//        if(deliveryimage==null || deliveryimage.length==0){
//            return "";
//        }
//        try {
//            return new String(deliveryimage,"UTF-8");
//        } catch (UnsupportedEncodingException e) {
//            e.printStackTrace();
//        }
//        return "";
//    }

    @Excel(name = "事故图片", width = 15)
    private transient java.lang.String accidentimagesString;

    private byte[] accidentimages;

    public byte[] getAccidentimages(){
        if(accidentimagesString==null){
            return null;
        }
        try {
            return accidentimagesString.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getAccidentimagesString(){
        if(accidentimages==null || accidentimages.length==0){
            return "";
        }
        try {
            return new String(accidentimages,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }

    @Excel(name = "行车证图片", width = 15)
    private transient java.lang.String licenseimageString;

    private byte[] licenseimage;

    public byte[] getLicenseimage(){
        if(licenseimageString==null){
            return null;
        }
        try {
            return licenseimageString.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getLicenseimageString(){
        if(licenseimage==null || licenseimage.length==0){
            return "";
        }
        try {
            return new String(licenseimage,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }

    /**修理厂地址*/
    @Excel(name = "修理厂地址", width = 15)
    @ApiModelProperty(value = "修理厂地址")
    private java.lang.String xlcaddress;
    /**修理厂联系方式*/
    @Excel(name = "修理厂联系方式", width = 15)
    @ApiModelProperty(value = "修理厂联系方式")
    private java.lang.String xlclink;
}
